package genetic;

import genetic.individual.MarioIndividual;

import java.util.Random;

import dk.itu.mario.MarioInterface.GamePlay;
import dk.itu.mario.MarioInterface.LevelGenerator;
import dk.itu.mario.MarioInterface.LevelInterface;

public class GeneticLevelGenerator implements LevelGenerator{

	public GeneticLevelGenerator(){
		System.out.println("Genetic Level Generator");	
	}
	
	@Override
	public LevelInterface generateLevel(GamePlay playerMetrics) {
		MarioIndividual geneticLevel = GeneticStart.runGenetic();
		
		int zones[] = new int[geneticLevel.getNumberOfGenes()];
		for(int i = 0; i < zones.length; i++){
			zones[i] = geneticLevel.getGene(i);
		}
		
		LevelInterface level = new GeneticLevel(new Random().nextLong(), 1, 0, zones);
		return level;
	}

	@Override
	public LevelInterface generateLevel(String detailedInfo) {
		return null;
	}

}
